//
//  IZHIMCustomerServiceManager.h
//  ZHIMCore
//
//  Created by Chen Zhangli on 2021/5/8.
//

#import <Foundation/Foundation.h>
#import "ZHIMCustomerServiceManagerDelegate.h"
#import "ZHIMCustomerService.h"
#import "ZHIMCSUser.h"

NS_ASSUME_NONNULL_BEGIN

@protocol IZHIMCustomerServiceManager <NSObject>

/// 添加回调代理
/// @param delegate 要添加的代理
- (void)addDelegate:(id<ZHIMCustomerServiceManagerDelegate>)delegate;


/// 移除回调代理
/// @param delegate 要移除的代理
- (void)removeDelegate:(id<ZHIMCustomerServiceManagerDelegate>)delegate;


/// 获取所有客服会话（针对客服人员），如果内存中不存在会从DB中加载
- (NSArray *)getAllCustomerServiceConversations;


/// 查询客服
/// @param completion 完成的回调
- (void)getCustomerServiceListFromServerWithPage:(NSInteger)pageIndex
                                        pageSize:(NSInteger)pageSize
                                      completion:(void (^)(NSArray *services, NSError *error))completion;

/// 查询当前登录用户是否存在客服角色
/// @param completion 完成的回调
- (void)startCustomerService:(NSString *)csId
                   forResult:(void (^)(NSError *error))completion;


/// 结束客服（手动触发客户满意度调查）
/// @param csId 客服号
/// @param evaluateId 服务对象
/// @param completion 完成的回调
- (void)endCustomerService:(NSString *)csId
                evaluateId:(NSString *)evaluateId
                 forResult:(void (^)(NSError *error))completion;

/// 查询客服号详情
/// @param csId 客服号
/// @param completion 完成的回调
- (void)getCustomerServiceByCsId:(NSString *)csId
        fromServerWithCompletion:(void (^)(ZHIMCustomerService *cs, NSError *error))completion;


/// 客服转接
/// @param csId 客服号id
/// @param transferId 转接人id
/// @param consultingId 咨询者Id
/// @param completion 触发结果回调
- (void)transferCustomerService:(NSString *)csId
                     transferId:(NSString *)transferId
                   consultingId:(NSString *)consultingId
                      forResult:(void (^)(NSError *error))completion;


/// 获取转接人
/// @param csId 客户号
/// @param completion 查询结果回调
- (void)getTransferUserListWithPage:(NSInteger)pageIndex
                             pageSize:(NSInteger)pageSize
                                 csId:(NSString *)csId
                            forResult:(void (^)(NSArray <ZHIMCSUser *> *users, NSError *error))completion;


/// 评价客服
/// @param csId 客服号id
/// @param evaluateId 客服（商务经理）
/// @param content 评价内容
/// @param completion 评价结果回调
- (void)evaluateCustomerService:(NSString *)csId
                     evaluateId:(NSString *)evaluateId
                        content:(NSString *)content
                      forResult:(void (^)(ZHIMMessage *message, NSError *error))completion;



/// 请求发送欢迎语
/// @param completion 请求结果回调
- (void)requestToSendWelcome:(NSString *)csId ForResult:(void (^)(NSError *error))completion;

@end

NS_ASSUME_NONNULL_END
